package study.zhangxh.annotations.observer;

import com.sun.mirror.apt.AnnotationProcessor;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
import com.sun.mirror.apt.AnnotationProcessorFactory;
import com.sun.mirror.declaration.AnnotationTypeDeclaration;
import com.sun.mirror.declaration.TypeDeclaration;

import java.util.Collection;
import java.util.Set;

/**
 * 说明
 *
 * @author: zhangxh
 * @email: zhangxh@cheegu.com
 * @date: 2018/6/26 21:30
 */
public class TableCreationProcessorFactory implements AnnotationProcessorFactory {
    @Override
    public Collection<String> supportedOptions() {
        return null;
    }

    @Override
    public Collection<String> supportedAnnotationTypes() {
        return null;
    }

    @Override
    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> set, AnnotationProcessorEnvironment annotationProcessorEnvironment) {
        return new TableCreationProcessor(annotationProcessorEnvironment);
    }

    private static class TableCreationProcessor implements AnnotationProcessor {
        private final AnnotationProcessorEnvironment env;
        private String sql = "";
        public TableCreationProcessor(AnnotationProcessorEnvironment env){
            this.env = env;

        }


        @Override
        public void process() {
            for (TypeDeclaration typeDeclaration : env.getSpecifiedTypeDeclarations()) {
                //typeDeclaration.accept(getDeclarationScanner());
            }
        }

    }
}
